Skip to content

Conversation

@rebtoor
Copy link
Contributor

@rebtoor rebtoor commented Nov 11, 2025

Enhance the cleanup_openstack role to support infrastructure reuse by
cleaning up OpenStack resources while preserving the OpenShift cluster
infrastructure. This enables faster test cycles by avoiding full
infrastructure reprovisioning.

Changes:

  • Add cleanup-openstack-for-reuse.yml playbook for direct use
  • Add cleanup_crs_direct.yaml to delete OpenStack CRs directly from cluster
  • Add cleanup_openstack_api.yaml to delete OpenStack API resources (servers,
    networks, volumes, etc.) before CR deletion to prevent orphaned resources
  • Add cleanup_storage.yaml to clean up PVCs, secrets, ConfigMaps, and PVs
  • Add cleanup_namespaces.yaml to optionally delete empty namespaces
  • Add common.yaml to eliminate code duplication (kubeconfig/auth params)
  • Refactor CR deletion patterns to use loops, reducing code duplication
  • Fix execution order: API resources are deleted first while control plane
    is still running, then CRs are deleted
  • Preserve infrastructure operators (NMState, MetalLB, OLM) for cluster reuse
  • Add configurable variables for granular cleanup control
  • Update README with comprehensive documentation

Assisted-By: Cursor AI Assistant

Related: OSPRH-21759

@rebtoor rebtoor requested a review from a team as a code owner November 11, 2025 11:35
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 11, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rebtoor rebtoor marked this pull request as draft November 11, 2025 11:36
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/7eaaa34d066444eba0136148611369dc

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 35m 57s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 14m 41s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 22m 14s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 24s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 39s
cifmw-pod-pre-commit FAILURE in 8m 10s
✔️ build-push-container-cifmw-client SUCCESS in 16m 33s
✔️ cifmw-molecule-cleanup_openstack SUCCESS in 2m 27s

@eshulman2
Copy link
Contributor

@rebtoor
Copy link
Contributor Author

rebtoor commented Nov 11, 2025

any reason not to use https://github.com/openstack-k8s-operators/ci-framework/blob/main/roles/cleanup_openstack/tasks/main.yaml ?

@eshulman2 (I deleted the previous comment because I completely misunderstood your question, sorry Ella 🙇🏻 )

BTW I want to keep use that role, i just tried to address some aspects:

  • I want to have the possibility to delete the resources on OCP based on their kind rather than reverse the content of the files. A "more aggressive" cleaning, so to speak.
  • I want to take care of the storage cleanup
  • I want to take care of the openstack resources

I don't know if all of this will lead to a bulletproof procedure but i heard some feedback about the reliability of this cleanup procedure and i'd like to improve it.

Any kind of suggestion is more than welcome though!

@rebtoor rebtoor changed the title [ci-framework-jobs] add cleanup-openstack-for-reuse playbook [cleanup_openstack] enhance cleanup for infrastructure reuse Nov 11, 2025
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/384b0a9282964a6cad26847d17890532

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 48m 02s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 15m 34s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 33m 25s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 36s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 45s
cifmw-pod-pre-commit FAILURE in 7m 57s
✔️ build-push-container-cifmw-client SUCCESS in 17m 09s
✔️ cifmw-molecule-cleanup_openstack SUCCESS in 2m 21s

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/689e395593904c7180a66b83f187edee

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 41m 30s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 26m 01s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 27m 34s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 43s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 08s
cifmw-pod-pre-commit FAILURE in 8m 08s
✔️ build-push-container-cifmw-client SUCCESS in 18m 53s
✔️ cifmw-molecule-cleanup_openstack SUCCESS in 2m 23s

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/d0f82689056044bab35e7d66f2f7c30d

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 46m 37s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 16m 30s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 31m 32s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 00s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 38s
cifmw-pod-pre-commit FAILURE in 8m 26s
✔️ build-push-container-cifmw-client SUCCESS in 16m 35s
✔️ cifmw-molecule-cleanup_openstack SUCCESS in 2m 26s

@rebtoor rebtoor force-pushed the OSPRH-21759 branch 6 times, most recently from 16471c0 to bf9b991 Compare November 12, 2025 18:07
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/131597c22c9049c281ec693790095b54

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 49m 05s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 16m 38s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 32m 04s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 47s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 51s
cifmw-pod-pre-commit FAILURE in 11m 02s
✔️ build-push-container-cifmw-client SUCCESS in 16m 27s
✔️ cifmw-molecule-cleanup_openstack SUCCESS in 2m 52s

@rebtoor rebtoor force-pushed the OSPRH-21759 branch 2 times, most recently from ef442aa to 83afa3d Compare November 13, 2025 12:40
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/6749298792164c1fb3eb416ca5225304

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 43m 05s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 23m 44s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 28m 49s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 25s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 38s
cifmw-pod-pre-commit FAILURE in 8m 08s
✔️ build-push-container-cifmw-client SUCCESS in 19m 37s
✔️ cifmw-molecule-cleanup_openstack SUCCESS in 2m 20s

Enhance the cleanup_openstack role to support infrastructure reuse by
cleaning up OpenStack resources while preserving the OpenShift cluster
infrastructure. This enables faster test cycles by avoiding full
infrastructure reprovisioning.

Changes:
- Add cleanup-openstack-for-reuse.yml playbook for direct use
- Add cleanup_crs_direct.yaml to delete OpenStack CRs directly from cluster
- Add cleanup_openstack_api.yaml to delete OpenStack API resources (servers,
  networks, volumes, etc.) before CR deletion to prevent orphaned resources
- Add cleanup_storage.yaml to clean up PVCs, secrets, ConfigMaps, and PVs
- Add cleanup_namespaces.yaml to optionally delete empty namespaces
- Add common.yaml to eliminate code duplication (kubeconfig/auth params)
- Add clean-config-drives-only.yml playbook to clean config drive ISO files
  for infrastructure reuse (prevents conflicts when reusing VMs)
- Refactor CR deletion patterns to use loops, reducing code duplication
- Fix execution order: API resources are deleted first while control plane
  is still running, then CRs are deleted
- Preserve infrastructure operators (NMState, MetalLB, OLM) for cluster reuse
- Add configurable variables for granular cleanup control
- Update README with comprehensive documentation
- Update dictionary with new terms from documentation

Related: OSPRH-21759

Signed-off-by: Roberto Alfieri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants